home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / comm / misc / xqsrc1_7.lzh / include / execlists.h < prev    next >
C/C++ Source or Header  |  1992-06-21  |  1KB  |  42 lines

  1. /*
  2.  *    Support for exec lists
  3.  */
  4.  
  5. #include <exec/types.h>
  6. #include <exec/lists.h>
  7. #include <exec/nodes.h>
  8.  
  9. /*
  10.  *    Access to list functions without type casting
  11.  */
  12.  
  13. #define INSERT(l, n, p) Insert((struct List *)(l), (struct Node *)(n), (struct Node *)(p))
  14. #define ADDHEAD(l, n) AddHead((struct List *)(l), (struct Node *)(n))
  15. #define ADDTAIL(l, n) AddTail((struct List *)(l), (struct Node *)(n))
  16. #define REMOVE(n) Remove((struct Node *)(n))
  17. #define REMHEAD(l) ((void *)RemHead((struct List *)(l)))
  18. #define REMTAIL(l) ((void *)RemTail((struct List *)(l)))
  19. #define ENQUEUE(l, n) Enqueue((struct List *)(l), (struct Node *)(n))
  20. #define FINDNAME(l, n) ((void *)FindName((struct List *)(l), (UBYTE *)(n)))
  21. #define NEWLIST(l) NewList((struct List *)l)
  22.  
  23. /*
  24.  *    Other useful list macros
  25.  */
  26.  
  27. #define FIRST(l) ((void *)(((struct List *)(l))->lh_Head))
  28. #define NEXT(n) ((void *)(((struct Node *)(n))->ln_Succ))
  29. #define LAST(l) ((void *)(((struct List *)(l))->lh_Tail))
  30. #define PREV(n) ((void *)(((struct Node *)(n))->ln_Pred))
  31. #define MORENODES(n) (((struct Node *)(n))->ln_Succ)
  32.  
  33.  
  34. /*
  35.  *    Example calling sequence for the above
  36.  
  37. for (n = FIRST(l); MORENODES(n); n = NEXT(n)) {
  38.  
  39.  *
  40.  */
  41.  
  42.